<template>
  <el-dialog
      :lock-scroll="false"
      width="1300px"
      top="80px"
      custom-class="kinglex-dialog"
      :visible.sync="dialogVisible"
      @close="closeDialog"
      :title="dialogTitle"
  >
    <div>
      <el-table
          :data="tableData"
          style="width: 100%">
        <el-table-column
            prop="id"
            label="用户id"
        >
        </el-table-column>
        <el-table-column
            prop="username"
            label="用户名"
        >
        </el-table-column>
        <el-table-column
            prop="classes"
            label="所属班级">
        </el-table-column>
        <el-table-column
            prop="sex"
            label="性别">
        </el-table-column>
        <el-table-column
            prop="mailbox"
            label="邮箱地址">
          <template slot-scope="scope">
            <span v-if="scope.row.mailbox===null">未设置</span>
            <span v-else>{{scope.row.mailbox}}</span>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: "allPeople",
  props: {
    visible: {
      type: Boolean,
      required: true
    },
    data:{
      type:Array,
      required: true
    }
  },
  model: {
    prop: 'visible',
    event: 'changeVisible'
  },
  data(){
    return{
      dialogTitle:'总检测人员信息',
      dialogVisible:false,
      tableData: []
    }
  },
  watch: {
    visible(val) {
      this.dialogVisible = val;
    },
    data(val){
      this.tableData = val;
    }
  },
  methods: {
    closeDialog() {
      this.$emit('changeVisible', false);
    },
  }
}
</script>

<style scoped>

</style>
